In a system for converting an output from a power source into an AC voltage by an inverter and driving the motor, the inverter has as element for performing switching at high speed in order to control the voltage applied to the motor. A smoothing capacitor is arranged between the inverter and the power source in order to smooth the voltage fluctuating by this switching. A relay is provided between the power source and the inverter in order to open and close the connection between them.
When the motor is driven, the voltage of a smoothing capacitor approximately equals the power source voltage, and in the case of a hybrid vehicle or an electric vehicle, the voltage becomes several hundreds of volts. In the maintenance, inspection and repair of the inverter, it is necessary to discharge the electric charge of the smoothing capacitor quickly after opening the relay so that their work can he performed safely.
PTL 1 suggests a method of discharging the electric charge of the smoothing capacitor by supplying a current to the motor. The current supplied to the motor is controlled so that the d-axis current whose direction is a direction of the magnetic flux of the rotor and which excite the motor together with the permanent magnets for motor excitation is made non-zero and the q-axis current which comes directly to the d-axis and that imparts torque to the motor is made zero. The current supplied to the motor is determined by a feedback control that operates so that the difference between the current value flowing through the motor detected by the current sensor and the target current value approaches zero.
As a result, the current can be supposed to the motor without generating torque in the motor, and electric power is consumed by the impedance of the winding, so that the electric charge of the smoothing capacitor is discharged.
However, when there is a detection error in the current sensor for detecting the motor current, an unintentional current may flow to the motor. The unintentional current is a current where the q-axis current is non-zero. When the q-axis current flows, torque is generated in the motor, and the motor may rotate.